package com.agan.workflow.controller;

import com.agan.common.core.web.controller.BaseController;
import com.agan.common.core.web.page.TableDataInfo;
import com.agan.workflow.domain.TaskVo;
import com.agan.workflow.service.ITaskService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 阿甘
 */

@RestController
@RequestMapping("/task")
@RequiredArgsConstructor
public class TaskController extends BaseController
{

    private final ITaskService taskService;
    /**
     * 查询我的任务
     */
    @GetMapping("/queryMyTask")
    public TableDataInfo queryMyTask(TaskVo taskVo) {
        return getDataTable(taskService.queryMyTask(taskVo));
    }

    /**
     * 我发起的流程
     */
    @GetMapping("/queryMyStartTask")
    public TableDataInfo queryMyStartTask(TaskVo taskVo) {
        return getDataTable(taskService.queryMyStartTask(taskVo));
    }

    /**
     * 我审批的流程
     */
    @GetMapping("/queryMyApprovalTask")
    public TableDataInfo queryMyApprovalTask(TaskVo taskVo) {
        return getDataTable(taskService.queryMyStartTask(taskVo));
    }

    /**
     * 我交办的流程
     */
    @GetMapping("/queryMyAssignmentTask")
    public TableDataInfo queryMyAssignmentTask(TaskVo taskVo) {
        return getDataTable(taskService.queryMyStartTask(taskVo));
    }
}
